<div class="catalog">

	<div class="user-info">

		<div class="top">

			<div class="welcome float-left">
				<?php echo Yii::t('app','Welcome'); ?> <strong><?php echo Yii::app()->user->name; ?></strong>!
			</div>

			<div class="logout float-right">
				<?php echo CHtml::link(Yii::t('app','Logout'),array('//site/logout')); ?>
			</div>

			<div class="clear">&nbsp;</div>

		</div>

		<?php if($reservationDataProvider->getData()!==array()): ?>

			<hr />

			<div class="reservations">

				<p class="tip"><?php echo Yii::t('app','You have reserved the following items'); ?>:</p>

				<?php $this->widget('zii.widgets.grid.CGridView',array(
					'id'=>'reservation-grid',
					'dataProvider'=>$reservationDataProvider,
					'template'=>'{items}',
					'hideHeader'=>true,
					'columns'=>array(
						array(
							'type'=>'raw',
							'value'=>'\'<strong>\'.$data->quantity.\'</strong> x \'.CHtml::link($data->item->product->name,array(\'//site/catalog\',\'#\'=>\'product-\'.$data->item->product->id))',
							'htmlOptions'=>array('class'=>'name-column'),
						),
						array(
							'type'=>'raw',
							'value'=>'CHtml::link(Yii::t(\'app\',\'Cancel Reservation\'),
								array(\'//item/cancelReservation\',\'reservationId\'=>$data->id),
								array(\'confirm\'=>Yii::t(\'app\',\'Are you sure you want to cancel this reservation\').\'?\'))',
							'htmlOptions'=>array('class'=>'cancel-column'),
						)
					),					
				)); ?>

			</div>

		<?php endif; ?>

	</div>

	<?php $this->widget('zii.widgets.CListView',array(
		'dataProvider'=>$dataProvider,
		'template'=>"{items}\n{pager}",
		'itemView'=>'//item/_view',
		'viewData'=>array(
			'models'=>$models,
		),
	)); ?>

</div>